package com.csx.set;

import com.csx.tree.BinarySearchTree;




/**
 * 二分搜索树集合
 * @param <E>
 */
public class BinarySearchTreeSet<E extends Comparable<E>> implements Set<E> {

    private BinarySearchTree<E> treeSet;

    public BinarySearchTreeSet(){
        treeSet = new BinarySearchTree<>();
    }

    @Override
    public void add(E e) {
        treeSet.add(e);
    }

    @Override
    public void remove(E e) {
        treeSet.remove(e);
    }

    @Override
    public boolean contains(E e) {
        return  treeSet.contains(e);
    }

    @Override
    public int getSize() {
        return treeSet.size();
    }

    @Override
    public boolean isEmpty() {
        return treeSet.isEmpty();
    }

    public static void main(String[] args) {

    }
}
